import re

# Markdown内容
markdown_content = """
|协议|地区|ip|端口|密码|链接|
|---|---|---|---|---|:---|
|TROJAN|<span class="node-name">日本JP·23</span> <span class="fs-p85 op-p80">深港IEPL</span>|163.177.46.177|28113|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.177:28113?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+23+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">日本JP·23</span> <span class="fs-p85 op-p80">沪港IEPL</span>|163.177.46.220|28113|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.220:28113?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+23+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">日本JP·V8</span> <span class="fs-p85 op-p80">深港IEPL</span>|163.177.46.177|28107|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.177:28107?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+V8+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">日本JP·V8</span> <span class="fs-p85 op-p80">沪港IEPL</span>|163.177.46.220|28107|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.220:28107?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+V8+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">日本JP·A140</span> <span class="fs-p85 op-p80">Netflix日本 ChatGPT解锁 深港IEPL</span>|163.177.46.177|28117|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.177:28117?allowInsecure=1&peer=ctldl.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+A140+%C2%B7+Netflix%E6%97%A5%E6%9C%AC+%C2%B7+ChatGPT%E8%A7%A3%E9%94%81+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">日本JP·A140</span> <span class="fs-p85 op-p80">Netflix日本 ChatGPT解锁 沪港IEPL</span>|163.177.46.220|28117|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.220:28117?allowInsecure=1&peer=ctldl.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+A140+%C2%B7+Netflix%E6%97%A5%E6%9C%AC+%C2%B7+ChatGPT%E8%A7%A3%E9%94%81+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">美国US·36</span> <span class="fs-p85 op-p80">深港IEPL</span>|163.177.46.177|28136|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.177:28136?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+36+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">美国US·36</span> <span class="fs-p85 op-p80">沪港IEPL</span>|163.177.46.220|28136|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.220:28136?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+36+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">美国US·88</span> <span class="fs-p85 op-p80">深港IEPL</span>|163.177.46.177|28109|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.177:28109?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+88+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">美国US·88</span> <span class="fs-p85 op-p80">沪港IEPL</span>|163.177.46.220|28109|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.220:28109?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+88+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">美国US·A250</span> <span class="fs-p85 op-p80">Netflix美国 ChatGPT解锁 深港IEPL</span>|163.177.46.177|28175|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.177:28175?allowInsecure=1&peer=ctldl.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+A250+%C2%B7+Netflix%E7%BE%8E%E5%9B%BD+%C2%B7+ChatGPT%E8%A7%A3%E9%94%81+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
|TROJAN|<span class="node-name">美国US·A250</span> <span class="fs-p85 op-p80">Netflix美国 ChatGPT解锁 沪港IEPL</span>|163.177.46.220|28175|hLBXsUgDY|trojan://hLBXsUgDY@163.177.46.220:28175?allowInsecure=1&peer=ctldl.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+A250+%C2%B7+Netflix%E7%BE%8E%E5%9B%BD+%C2%B7+ChatGPT%E8%A7%A3%E9%94%81+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
"""

# 正则表达式匹配Trojan链接
pattern = re.compile(r'trojan://([^@]+)@([^:]+):(\d+)\?([^#]+)#(.*)')
matches = pattern.findall(markdown_content)

# 收集链接
links = []
for match in matches:
    password = match[0]
    ip = match[1]
    port = match[2]
    query_string = match[3]
    comment = match[4]
    link = f"trojan://{password}@{ip}:{port}?{query_string}#{comment}"
    links.append(link)

# 一行行打印链接
for link in links:
    print(link)


# 输出结果
# trojan://hLBXsUgDY@163.177.46.177:28113?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+23+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.220:28113?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+23+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.177:28107?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+V8+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.220:28107?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+V8+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.177:28117?allowInsecure=1&peer=ctldl.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+A140+%C2%B7+Netflix%E6%97%A5%E6%9C%AC+%C2%B7+ChatGPT%E8%A7%A3%E9%94%81+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.220:28117?allowInsecure=1&peer=ctldl.windowsupdate.com#IEPL+%C2%B7+%E6%97%A5%E6%9C%ACJP+%C2%B7+A140+%C2%B7+Netflix%E6%97%A5%E6%9C%AC+%C2%B7+ChatGPT%E8%A7%A3%E9%94%81+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.177:28136?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+36+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.220:28136?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+36+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.177:28109?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+88+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.220:28109?allowInsecure=1&peer=download.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+88+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.177:28175?allowInsecure=1&peer=ctldl.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+A250+%C2%B7+Netflix%E7%BE%8E%E5%9B%BD+%C2%B7+ChatGPT%E8%A7%A3%E9%94%81+%C2%B7+%E6%B7%B1%E6%B8%AFIEPL|
# trojan://hLBXsUgDY@163.177.46.220:28175?allowInsecure=1&peer=ctldl.windowsupdate.com#IEPL+%C2%B7+%E7%BE%8E%E5%9B%BDUS+%C2%B7+A250+%C2%B7+Netflix%E7%BE%8E%E5%9B%BD+%C2%B7+ChatGPT%E8%A7%A3%E9%94%81+%C2%B7+%E6%B2%AA%E6%B8%AFIEPL|
